package com.kymatrix.kycarbon.xsmd.kbpm.server.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kymatrix.kycarbon.xsmd.kbpm.server.model.form.define.PageQueryProcessDefineResp;
import com.kymatrix.kycarbon.xsmd.kbpm.server.model.entity.ProcessDefineEntity;
import com.kymatrix.kycarbon.xsmd.kbpm.server.model.form.define.PageQueryProcessDefineReq;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
 * 流程定义 Mapper 接口
 * </p>
 *
 * @author mldong
 * @since 2023-09-26
 */
@Mapper
public interface ProcessDefineMapper extends BaseMapper<ProcessDefineEntity> {
    List<PageQueryProcessDefineResp> selectCustom(IPage<PageQueryProcessDefineResp> page, @Param(Constants.WRAPPER) Wrapper<ProcessDefineEntity> wrapper);
    PageQueryProcessDefineResp findById(@Param("id") Long id);

    /**
     * 根据名称获取最新的流程定义
     * @param name
     * @return
     */
    PageQueryProcessDefineResp selectLastByName(@Param("name") String name);

    Page<PageQueryProcessDefineResp> pageQuery(IPage<PageQueryProcessDefineResp> page,
                                               @Param("param") PageQueryProcessDefineReq param);
}
